<include path="header" />
<div class="m-title">
    <ul>
      <li>知识检索</li>
      <li><a href="/knowledge/index">知识管理</a></li>
      <li><a href="/knowledge">我的主题</a></li> 
      <li></li>
    </ul>
</div>
    <div class="box">
        <div class="searchbox">
            <form action="/knowledge/search" method="get">                
				
                <div>
                    <input type="text" id="search" name="search">
                    <input type="submit" class="button" value="搜索">
                </div>
                <span>在添加内容前，请先搜索确认是否有相似内容已经存在</span>          
            </form>
        </div>
        <div>
          <ul>
          	<? if(empty($result)){ ?> 
              <li class="partition-lighter">
                  <h6>添加：<a href="add?keyword=<?=$keyword?>"><?=$keyword ?></a></h6>
              </li>
            <? }else{ foreach($result as $li){ ?>
            <li class="partition-lighter">                
                <div>
                    <div class="left">
                    <h6><a href="/knowledge/view?id=<?=$li['knowledge_id']?>"><?=$li['subject'] ?></a><? if($li['atta_count'] > 0){ ?><span>[附]</span><? } ?></h6>
                    <?=$li['message'] ?><br /> 
                    </div>
                    <div class="right">
                        <div class="avatar center">
                        	<img src="<?=get_avatar($li['user_id'])?>"/><br />
                            <a href="#"><?=$li['username'] ?></a>
                        </div>
                    </div>
                    <div class="clear"></div>
                </div>
            </li>        
            <? }} ?>          
          </ul>
        </div>
    </div>
<include path="footer" />